INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/device/include/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/debug/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/cmsis_lib/include/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/cmsis_boot/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/port)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/uip)


SET(PORT_LIST port/clock-arch.c
			port/tapdev.c
			port/uip-task.c)

SET(UIP_LIST uip/psock.c
				uip/timer.c
				uip/uip-fw.c
				uip/uip-neighbor.c
				uip/uip-split.c
				uip/uip.c
				uip/uiplib.c
				uip/uip_arp.c)

SET(UIPLIB_LIST lib/memb.c)

if(UIP_USE_WEBD)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/apps/webserver)
SET(UIPAPP_LIST apps/webserver/http-strings.c
				apps/webserver/httpd-cgi.c
				apps/webserver/httpd-fs.c
				apps/webserver/httpd.c)
endif(UIP_USE_WEBD)

if(UIP_USE_WEBC)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/apps/webclient)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/apps/resolv)
SET(UIPAPP_LIST apps/webclient/webclient-strings.c
				apps/webclient/webclient.c
				apps/resolv/resolv.c)
endif(UIP_USE_WEBC)

if(UIP_USE_TELNET)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/apps/telnetd)
SET(UIPAPP_LIST apps/telnetd/telnetd.c
				apps/telnetd/uipshell.c)
endif(UIP_USE_TELNET)

if(UIP_USE_SMTP)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/uip/apps/smtp)
SET(UIPAPP_LIST apps/smtp/smtp-strings.c
				apps/smtp/smtp.c)
endif(UIP_USE_TELNET)

ADD_LIBRARY(uip STATIC ${PORT_LIST}
				${UIP_LIST}
				${UIPLIB_LIST}
				${UIPAPP_LIST})						
